package com.helloworld.controller;

import com.helloworld.service.UserService;
import com.helloworld.vo.User.UserListReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RouterController {

    @Autowired
    private UserService userService;

    @GetMapping({"/","/index"})
    public String index(Model model, UserListReq req){
        model.addAttribute("users",userService.queryUserList(req.getNameLike()));
        return "User";
    }





}
